package com.pyip.reggie.controller;

import com.pyip.reggie.Entity.Orders;
import com.pyip.reggie.common.R;
import com.pyip.reggie.service.OrdersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {


    @Autowired
    private OrdersService ordersService;


    /**
     * 用户下单
     * @param orders
     * @return
     */
    @RequestMapping(value = "/submit",method = RequestMethod.POST)
    public R<String> submit(@RequestBody Orders orders){
        log.info("orders is {}",orders);
        return ordersService.submit(orders);
    }


}
